home *** CD-ROM | disk | FTP | other *** search
- '--------------------------------------------------------------------------
- ' EnumFonts.vbs - Enumerates fonts from the system directory
- '
- ' This file is part of the sgVersionInfo.
- ' Copyright (C) 1998 Stinga
- ' All rights reserved.
- '--------------------------------------------------------------------------
-
- on error resume next
-
- ' sgFileFlag constants
- const sgVS_FF_DEBUG = &H00000001
- const sgVS_FF_PRERELEASE = &H00000002
- const sgVS_FF_PATCHED = &H00000004
- const sgVS_FF_PRIVATEBUILD = &H00000008
- const sgVS_FF_INFOINFERRED = &H00000010
- const sgVS_FF_SPECIALBUILD = &H00000020
-
- ' sgFileOS constants
- const sgVOS_UNKNOWN = &H00000000
- const sgVOS_DOS = &H00010000
- const sgVOS_OS216 = &H00020000
- const sgVOS_OS232 = &H00030000
- const sgVOS_NT = &H00040000
- const sgVOS__BASE = &H00000000
- const sgVOS__WINDOWS16 = &H00000001
- const sgVOS__PM16 = &H00000002
- const sgVOS__PM32 = &H00000003
- const sgVOS__WINDOWS32 = &H00000004
- const sgVOS_DOS_WINDOWS16 = &H00010001
- const sgVOS_DOS_WINDOWS32 = &H00010004
- const sgVOS_OS216_PM16 = &H00020002
- const sgVOS_OS232_PM32 = &H00030003
- const sgVOS_NT_WINDOWS32 = &H00040004
-
- ' sgFileType constants
- const sgVFT_UNKNOWN = &H00000000
- const sgVFT_APP = &H00000001
- const sgVFT_DLL = &H00000002
- const sgVFT_DRV = &H00000003
- const sgVFT_FONT = &H00000004
- const sgVFT_VXD = &H00000005
- const sgVFT_STATIC_LIB = &H00000007
-
- ' sgFileSubtype constants
- const sgVFT2_UNKNOWN = &H00000000
- const sgVFT2_DRV_PRINTER = &H00000001
- const sgVFT2_DRV_KEYBOARD = &H00000002
- const sgVFT2_DRV_LANGUAGE = &H00000003
- const sgVFT2_DRV_DISPLAY = &H00000004
- const sgVFT2_DRV_MOUSE = &H00000005
- const sgVFT2_DRV_NETWORK = &H00000006
- const sgVFT2_DRV_SYSTEM = &H00000007
- const sgVFT2_DRV_INSTALLABLE = &H00000008
- const sgVFT2_DRV_SOUND = &H00000009
- const sgVFT2_DRV_COMM = &H0000000A
- const sgVFT2_DRV_INPUTMETHOD = &H0000000B
- const sgVFT2_FONT_RASTER = &H00000001
- const sgVFT2_FONT_VECTOR = &H00000002
- const sgVFT2_FONT_TRUETYPE = &H00000003
-
-
- set VerInfo = WScript.CreateObject("SGVersionInfo.VersionInfo")
- Set wsh = WScript.CreateObject("Wscript.Shell")
- Set fs = WScript.CreateObject("Scripting.FileSystemObject")
- Set foldr = fs.GetFolder(wsh.SpecialFolders("Fonts"))
-
- for each file in foldr.Files
- VerInfo.Path = file.Path
- if VerInfo.InfoExist And VerInfo.FileType = sgVFT_FONT Then
- rc = WScript.Echo(file.name + " " + cstr(VerInfo.FileType) + ", " + cstr(VerInfo.FileSubtype), 1)
- if rc = 2 then wscript.quit(0)
- end if
- next
-
- MsgBox "Finished"
-
- set VerInfo = nothing
- Set wsh = nothing
- Set fs = nothing
- Set foldr = nothing
-